package com.jobpass.controller;

import com.jobpass.common.data.ResultData;
import com.jobpass.common.model.Monthly;
import com.jobpass.common.service.MonthlyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: Qning
 * @Description: 实习月报
 * @Date: 2020/7/22 22:29
 * @PackageName: com.jobpass.controller
 * @ClassName: MonthlyController
 */
@Api(tags="实习月报Controller")
@RestController
@RequestMapping("student")
public class MonthlyController {
    @Resource
    private MonthlyService monthlyService;

    /**
     *
     * @Author: Qning
     * @Description: 实习月报
     * @Date: 22:54 2020/7/22
     * @param monthly
     * @return: com.jobpass.common.data.ResultData
     */
    @ApiOperation(value="实习月报")
    @PostMapping("/saveMonth")
    public ResultData saveMonth(@RequestBody Monthly monthly){
        int i = monthlyService.SavaMonthly(monthly);
        if (i == 1) {
            return ResultData.success();
        }
        return ResultData.fail();
    }
}
